package pojo;

public class GirlFactory
{
    private Girl girl = new Girl();

    public Girl getGirl()
    {
        System.err.println("调用工厂方法获取女孩对象");
        return girl;
    }

    public Girl getGirl(String name ,Integer age)
    {
        System.err.println("调用工厂方法获取女孩对象");
        girl.setName(name);
        girl.setAge(age);
        return girl;
    }
}
